﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
//using MongoDAO;
//using MongoDAO.Attributes;
//using MongoDAO.Management;
//using MongoDAO.Repository;
//using MongoDB.Bson;
//using MongoDB.Bson.Serialization.Attributes;
//using MongoDB.Driver;
//using MongoDB.Driver.Builders;
//using NUnit.Framework;

//namespace MongoDAOTest
//{
//    [TestFixture]
//    public class BsonTests
//    {
//        private MongoDatabase _database;
//        private Repository<DateObject> _repository;

//        [TestFixtureSetUp]
//        public void FixtureSetUp()
//        {
//            _database = Tools.GetDatabase("localhost", "test");
//            _repository = new Repository<DateObject>(_database);
//        }

//        [SetUp]
//        public void SetUp()
//        {
//            _database.DropCollection("Dates");
//            var dates = new[]
//                {
//                    new DateObject() {Date = new DateTime(2012, 1, 1)},
//                    new DateObject() {Date = new DateTime(2012, 1, 1)},
//                    new DateObject() {Date = new DateTime(2013, 1, 1)},
//                    new DateObject() {Date = new DateTime(2013, 2, 1)},
//                    new DateObject() {Date = new DateTime(2013, 3, 1)},
//                };
//            _repository.InsertBatch(dates);
//        }

//        [Test]
//        public void Find_Dates()
//        {
//            var collection = new MongoCollection<DateObject>(_database, "Dates", new MongoCollectionSettings());
//            collection.FindAs<DateObject>(Query<DateObject>.EQ(x => x.Date.Year, 2012));
//        }
//    }

//    [CollectionName("Dates")]
//    public class DateObject : TDocument
//    {
//        public DateTime Date { get; set; }
//    }
//}
